<template>
  <div class="room-content home page-tab">
    <Navbar :appTitle="title" :rtitle="rtitle" :rname="rname" />
    <div class="content-application">
      <div class="menus-card" :key="index1">
        <div v-for="(item, index) in datalist" :key="index" class="menus-card-box">
          <h1 class="title">{{ item.groupName }}</h1>
          <div style="width: 100%">
            <div v-for="res in item.applyList" :key="res.id" class="box menu flex-column align" @click="go(res.url)">
              <div v-if="res.attachment">
                <!-- <img :src="require(`../../assets/home/img/${res.attachment}`)" class="imgicon" alt="" /> -->
                <img :src="baseImgUrl + res.attachment" class="imgicon" alt="" />
              </div>
              <div v-else>
                <img src="../../assets/home/img/2.png" class="imgicon" alt="" />
              </div>
              <span class="label">{{ res.name }}</span>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import Navbar from "@/components/navBar/navBar_right";
import { commonlyQueryApplyForm } from "@/api/system";
import { apiBaseUrl } from "@/utils/request.js"
// import { prefixConfig } from "@/api/produce.js"
export default {
  name: "apply",
  components: { Navbar },
  data() {
    return {
      title: "发起申请",
      rtitle: "",
      rname: "", //search
      datalist: [],
      index1: 1,
      baseImgUrl: ''
    };
  },
  computed: {},
  
  created() {
    this.baseImgUrl = apiBaseUrl + '/jksaas-mgt/mgt'
  },
  mounted() {
    // 申请菜单
    let that = this
    commonlyQueryApplyForm().then((res) => {
      if (res.result) {
        let arr = res.result;
        that.datalist =  res.result;
        that.index1++
      } else {
        this.$toast(res.message);
      }
    });
  },
  methods: {
    go(menu) {
      this.$router.push(menu);
    },
  },
};
</script>
<style lang="scss" scoped>
$placeholder: #ccc;
$fontColortit: #191f25;
$fonttit: 0.15rem;
$fonttxt: 0.14rem;

::-webkit-input-placeholder {
  color: $placeholder;
}
::-moz-placeholder {
  color: $placeholder;
}

:-ms-input-placeholder {
  color: $placeholder;
}
/*公共class部分*/

/*通用标题*/
.publicTit {
  font-size: $fontColortit;
  color: red;
}
::-webkit-input-placeholder {
  color: $placeholder;
}

::-moz-placeholder {
  color: $placeholder;
}

:-ms-input-placeholder {
  color: $placeholder;
}

.home {
  background: #f4f5f6;
  .bg {
    height: 100%;
    background: #f4f5f6;
    .radius {
      height: 1.7rem;
      background: #1e8df5;
      border-radius: 0px 0px 20px 20px;
    }
  }
  .box {
    width: 25%;
    display: inline-flex;
    margin-bottom: 0.15rem;
  }
  .content-application {
    .project-name {
      font-size: 0.18rem;
      color: rgb(0, 0, 0);
      font-weight: normal;
    }
    .info-list {
      margin: 0.25rem 0;
      .info {
        flex: 1;
        .info-label {
          font-size: 0.12rem;
          color: #f4f5f6;
        }
        .info-value {
          font-size: 0.18rem;
          color: #fff;
        }
      }
    }
    .menus-card-box {
      background: #ffffff;
      margin-bottom: 10px;
    }
    .menus-card {
      margin-top: 20px;
      flex-flow: wrap;

      padding-bottom: 0;
      border-radius: 5px;
      .title {
        color: $fontColortit;
        font-size: $fonttit;
        width: 100%;
        padding: 10px 16px;
      }
      .icon-img {
        font-size: 22px !important;
        color: #fff;
      }
      .menu {
        width: 25%;
        margin-bottom: 0.15rem;
        .icon {
          display: flex;
          align-items: center;
          justify-content: center;
          border: 1px solid rgb(0, 106, 255);
          background: rgb(0, 106, 255);
          border-radius: 10px;
          width: 0.4rem;
          height: 0.4rem;
        }
        .label {
          display: inline-block;
          // height: 40px;
          text-align: center;
          width: 100%;
          line-height: 20px;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
          margin-top: 6px;
          font-size: $fonttxt !important;
          color: $fontColortit;
        }
      }
    }
    .tab-list {
      padding: 0.11rem 0;
      .tab {
        margin-right: 0.44rem;
        &:last-child {
          margin-right: 0;
        }
      }
      .label {
        line-height: 0.24rem;
        font-size: $fonttit;
        color: $fontColortit;
      }
      .border {
        display: block;
        opacity: 0;
        margin-top: 4px;
        width: 28px;
        height: 2px;
        background: #1e8df5;
        border-radius: 1px;
      }
      .selected .border {
        opacity: 1;
      }
      .van-badge {
        right: -10px;
      }
    }
  }
  .list {
    .item {
      padding: 0.09rem 0.12rem;
      background: #fff;
      border-radius: 5px;
      font-size: 0.12rem;
      .time {
        color: #929292;
      }
      .title {
        margin: 0.13rem 0;
        font-size: 0.14rem;
        color: $fontColortit;
      }
      .user-info {
        padding-bottom: 0.1rem;
        font-size: 0.12rem;
        color: #323232;
        border-bottom: 1px solid #eeeeee;
        .icon {
          width: 0.12rem;
        }
        .label {
          margin: 0 0.1rem;
        }
      }
      .bottom {
        padding-top: 0.12rem;
        font-size: 0.12rem;
        color: #888;
        button {
          height: 0.22rem;
          padding: 0 0.1rem;
          border-radius: 0.11rem;
          border: 1px solid #dfdfdf;
        }
      }
    }
  }
}
.imgicon {
  width: 0.3rem !important;
  height: 0.3rem !important;
}
</style>
